/*
 * Block.h
 *
 *  Created on: Apr 16, 2012
 *      Author: jaap
 */

#ifndef BLOCK_H_
#define BLOCK_H_

#include <cassert>
#include "const.h"
#include "types.h"
#include "e7convert.h"

class Block {
	friend class Device;
	int number;
	byte bytes[DBLKSIZ];
	bool super;
public:
	Block(int number);
	byte* getBytes(int offset, int length);
	byte* getBytes();
	bool isSuperBlock();
	/* Getting size in blocks of i-list (see info/filsys.h) */
	int getAmountOfInodeBlocks();
	/* Getting size in blocks of entire volume (see info/filsys.h) */
	int getAmountOfBlocks();
};

#endif /* BLOCK_H_ */
